package Performance 
{
	import flash.display.Sprite;
	import flash.utils.Dictionary;
	import iscript.coreFramework.data.HashTable;
	import iscript.gameFramework.GameLite.debug.PerformanceTest;
	import iscript.gameFramework.GameLite.Game;
 
	public class PT  extends  Sprite 
	{
		
		public function PT() 
		{
			
			
			var g:Game = new Game(stage);
			
			Game.Content.addSwf("http://app26483.imgcache.qzoneapp.com/app26483/raymond/user_run.swf");
			
			
			trace(Game.Content.count);
			
		 	Game.Content.removeContent("http://app26483.imgcache.qzoneapp.com/app26483/raymond/user_run.swf")
		 	trace(Game.Content.count);
			
			
			
	/*		
			
			var ptest:PerformanceTest = PerformanceTest.getInstance();
			ptest.out = trace;
			ptest.testFunction(TestArray)
			ptest.testFunction(TestVector)
			ptest.testFunction(TestDictionary)
			ptest.testFunction(TestHashTable)*/
			
		/*	 var d:Dictionary = new Dictionary();
			d["name"]="123123213"
			trace(d["name"])
			delete d["name"]
			trace( d["name"]==null)*/
			
		 
		}
		
		
		protected function test():void {
			for (var i:int=0; i<100000; i++) {
				Math.random();
			}
		}
		
		protected function TestArray():void {
			var data:Array = new Array();
			   for (var i:int=0; i<10000; i++) {
			      if(data.indexOf(i)==-1){
				     data.push(i)
				   }
			    }
			}

			
		protected function TestVector():void {
			var data:Vector.<int> = new Vector.<int>();
			   for (var i:int=0; i<10000; i++) {
			      if(data.indexOf(i)==-1){
				     data.push(i)
				   }
			    }
			  	
			 
			}	
		
 
		protected function TestDictionary():void {
			var data:Dictionary = new Dictionary()
			   for (var i:int=0; i<100000; i++) {
			      if(data[i]==null){
				     data[i]=i
				   }
			    }
				trace("====Dictionary=====")
			}		
		
		protected function TestHashTable():void {
			var data:HashTable = new HashTable();
			    for (var i:int=0; i<1000; i++) {
			       data.add(i, i);  
			    }
			}
		
	}

}